package geez.widget;


import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.ui.MenuBar;
import com.google.gwt.user.client.ui.MenuItem;

import static geez.widget.Geez.withStyle;

public class GMenuItem extends MenuItem implements GWidget {

    public GMenuItem(String text, Command cmd) {
        super(text, cmd);
    }

    public GMenuItem(String text, boolean asHTML, Command cmd) {
        super(text, asHTML, cmd);
    }

    public GMenuItem(String text, MenuBar subMenu) {
        super(text, subMenu);
    }

    public GMenuItem(String text, boolean asHTML, MenuBar subMenu) {
        super(text, asHTML, subMenu);
    }

    public GMenuItem id(String id) {
        Geez.withNameAndId(this, id);
        return this;
    }

    public GMenuItem css(String cssClass, String... optionalClasses) {
        withStyle(this, cssClass, optionalClasses);
        return this;
    }


    public GMenuItem show() {
        setVisible(true);
        return this;
    }

    public GMenuItem hide() {
        setVisible(false);
        return this;
    }

    public GMenuItem text(String text) {
        setText(text);
        return this;
    }

    public GMenuItem width(String value) {
        setWidth(value);
        return this;
    }

    public GMenuItem height(String value) {
        setHeight(value);
        return this;
    }
}
